/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-06-05
 * Time: 23:04
 */
public class Test {
    public static void fun(String str){
        int n=0;
        int o=0;
        for (int i = 0; i < str.length(); i++) {
                if(str.charAt(i)=='n')
                n++;
                if(str.charAt(i)=='o')
                o++;
        }
        System.out.println("n出现的次数为"+n);
        System.out.println("o出现的次数为"+o);
    }
    public static void main(String[] args) {
        String str="want you to know one thing";
        fun(str);
    }
}
